package com.opensource.component.validate;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.function.Consumer;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * @author zhanglong
 * @description: 描述
 * @date 2019-08-3113:48
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class ValidationListResult<T> extends BaseValidationResult<ValidationListResult<T>> {

    private List<T> successData = new ArrayList<>();

    private Map<T, Map<String, String>> errorData = new HashMap<>();

    /**
     * description 如果是null的话 不额外处理校验结果，如果需要额外处理校验结果需要 {@link Consumer}
     */
    @Override
    public void consumer(Consumer<ValidationListResult<T>> validationListResultConsumer ) {
        validationListResultConsumer.accept(this);
    }
}



